// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the “License”);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// <https://apache.org/licenses/LICENSE-2.0>.
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an “AS IS” BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// This file was generated by scripts/generate-benchmark.py, do not modify!

const dataBig = [{
  a: '0x5BECAB4C092B45AC75D1E7213F9E4A373FCABA255',
  r: '-0x5BECAB4C092B45AC75D1E7213F9E4A373FCABA256',
}, {
  a: '-0xF3D0430730DB21F35E0894B089274646ADB804277',
  r: '0xF3D0430730DB21F35E0894B089274646ADB804276',
}, {
  a: '-0x6477417D191FA503D78D752A4E31B8071DE0D6E4DCA2',
  r: '0x6477417D191FA503D78D752A4E31B8071DE0D6E4DCA1',
}, {
  a: '0x59B9439BD6E0DD6A37933E42B4642224CB416612C9F16D9307A2FABA9D04581BEADA0D',
  r: '-0x59B9439BD6E0DD6A37933E42B4642224CB416612C9F16D9307A2FABA9D04581BEADA0E',
}, {
  a: '0x408E100AB93FC1963F46E1D8D93F2E63400AE243AE9CBFF0EF',
  r: '-0x408E100AB93FC1963F46E1D8D93F2E63400AE243AE9CBFF0F0',
}, {
  a: '0x3C94BD2E654F9DA5AFC16452A66ECAB177C6B4C812050BA18177B173',
  r: '-0x3C94BD2E654F9DA5AFC16452A66ECAB177C6B4C812050BA18177B174',
}, {
  a: '-0x1401E70D8EAB3374854CA70C49C77EE94CAA2CF3CA6233257FACCE565',
  r: '0x1401E70D8EAB3374854CA70C49C77EE94CAA2CF3CA6233257FACCE564',
}, {
  a: '0x2449EC813157C5C605FDA632F92053B0857ED0C4EEB9FBDA16F96D8CC',
  r: '-0x2449EC813157C5C605FDA632F92053B0857ED0C4EEB9FBDA16F96D8CD',
}, {
  a: '-0xD3D090E48A157CFC90CCE83A65934E59DC571F227E51312D518026FCEAF60098EE',
  r: '0xD3D090E48A157CFC90CCE83A65934E59DC571F227E51312D518026FCEAF60098ED',
}, {
  a: '0xAE9C68CC00F399AB07558DCC677DC7F4597681AD598',
  r: '-0xAE9C68CC00F399AB07558DCC677DC7F4597681AD599',
}, {
  a: '0x9FD374B13EF1696A3AD310865431161ABEF8BE',
  r: '-0x9FD374B13EF1696A3AD310865431161ABEF8BF',
}, {
  a: '-0xB91D2F639C7E28836FCD1E7B110B2368C192C0E6DFA220',
  r: '0xB91D2F639C7E28836FCD1E7B110B2368C192C0E6DFA21F',
}, {
  a: '-0xD914B005932D9155F6C5DC3B8C7B5D0BA17E52097B9B37DFC',
  r: '0xD914B005932D9155F6C5DC3B8C7B5D0BA17E52097B9B37DFB',
}, {
  a: '0xC3963A09154BADD909C03CE6C0DF87E1DFEBA8BA5C57D7A17BC168B16ED4A548852586',
  r: '-0xC3963A09154BADD909C03CE6C0DF87E1DFEBA8BA5C57D7A17BC168B16ED4A548852587',
}, {
  a: '-0xA728FAEB831D367FDDCD8E83CF2F01951B5E086DFD2DA6DCBE292DC98980',
  r: '0xA728FAEB831D367FDDCD8E83CF2F01951B5E086DFD2DA6DCBE292DC9897F',
}, {
  a: '-0xB50B4EB85410738FEB79D300C7044AF1ADF5C',
  r: '0xB50B4EB85410738FEB79D300C7044AF1ADF5B',
}, {
  a: '-0x631E1E8F10F68227440DC1309FE07439EF87BCCF147FED6FEB816FCABAFFFFA86C111D',
  r: '0x631E1E8F10F68227440DC1309FE07439EF87BCCF147FED6FEB816FCABAFFFFA86C111C',
}, {
  a: '0x40E45C90375194E06EADC10A79B33E1ED8772FFED',
  r: '-0x40E45C90375194E06EADC10A79B33E1ED8772FFEE',
}, {
  a: '0x70C53E752DB612C7C6157AF9B3E7C2F1179CD5430B980E9C30CC25DA1C8BDE',
  r: '-0x70C53E752DB612C7C6157AF9B3E7C2F1179CD5430B980E9C30CC25DA1C8BDF',
}, {
  a: '0x7A438D9EEE20B97918C3549BB209D7CC7EBE',
  r: '-0x7A438D9EEE20B97918C3549BB209D7CC7EBF',
}, {
  a: '0xF2081B0D0278A8E6548023BB6327A0505C4359FF1848CA1378BBF3D8390B5F551A16C',
  r: '-0xF2081B0D0278A8E6548023BB6327A0505C4359FF1848CA1378BBF3D8390B5F551A16D',
}, {
  a: '0x9AEAC177ED1059CA28DFA726082F17EF199E60A8190327C5043EDD7C1FE96D958C',
  r: '-0x9AEAC177ED1059CA28DFA726082F17EF199E60A8190327C5043EDD7C1FE96D958D',
}, {
  a: '-0xD835CB6DFB98613C4E5C1E596216977602F4DD202CB92F31AEE0D',
  r: '0xD835CB6DFB98613C4E5C1E596216977602F4DD202CB92F31AEE0C',
}, {
  a: '-0x506467DA1D43044BDE911D153EB18530223BD59EAA662169BC39AED6',
  r: '0x506467DA1D43044BDE911D153EB18530223BD59EAA662169BC39AED5',
}, {
  a: '-0x5CDE698BE3E7F18520AAABECA7B757E6F2F4E9D877B1102AB03E4962054',
  r: '0x5CDE698BE3E7F18520AAABECA7B757E6F2F4E9D877B1102AB03E4962053',
}, {
  a: '0x64AB524CA578CC6A0D5538E74DB627BB27D151B1611033A29D9B42B418D6602B3',
  r: '-0x64AB524CA578CC6A0D5538E74DB627BB27D151B1611033A29D9B42B418D6602B4',
}, {
  a: '0x547C93391173F29AF0D24BABB3FCCC14C0800C6066190B35',
  r: '-0x547C93391173F29AF0D24BABB3FCCC14C0800C6066190B36',
}, {
  a: '-0x5F4C091DAE3C4B6D9DDDE59938E857F843B97F8039EA20',
  r: '0x5F4C091DAE3C4B6D9DDDE59938E857F843B97F8039EA1F',
}, {
  a: '-0x3236DE4EA2EE2554E4FBD5442DFB952C48F690735D7D81DC9D2B91AFC1',
  r: '0x3236DE4EA2EE2554E4FBD5442DFB952C48F690735D7D81DC9D2B91AFC0',
}, {
  a: '-0xF16363559F5BD802455941FD4995613CF575519DDC730BD9E',
  r: '0xF16363559F5BD802455941FD4995613CF575519DDC730BD9D',
}, {
  a: '-0xADA72C0362D4B2062A7DAB4C542F58C400B399726A412494',
  r: '0xADA72C0362D4B2062A7DAB4C542F58C400B399726A412493',
}, {
  a: '0xD152D28D8687D36D426E85727304026AF7AEAC8CE840824835959628E',
  r: '-0xD152D28D8687D36D426E85727304026AF7AEAC8CE840824835959628F',
}, {
  a: '0x916C525DFA1DDBAEB50BA1C1FEAF191EB7D35EE4EE055706F',
  r: '-0x916C525DFA1DDBAEB50BA1C1FEAF191EB7D35EE4EE0557070',
}, {
  a: '0x14A3B2B7E26E92397BA2FC216EEB6C08D0344A96FA18AC',
  r: '-0x14A3B2B7E26E92397BA2FC216EEB6C08D0344A96FA18AD',
}, {
  a: '-0x94FE986B2B259F0CEE01B5FE9EDDAD4769E3F11A32F6F08C42635C0040860AC1',
  r: '0x94FE986B2B259F0CEE01B5FE9EDDAD4769E3F11A32F6F08C42635C0040860AC0',
}, {
  a: '-0x5474845EE8F9188A12F223509027678D160034',
  r: '0x5474845EE8F9188A12F223509027678D160033',
}, {
  a: '0x209EAADD8DD5242C16EFC55EFDFB9680306EF9A2FC856B298A349EEE4CB78',
  r: '-0x209EAADD8DD5242C16EFC55EFDFB9680306EF9A2FC856B298A349EEE4CB79',
}, {
  a: '0xCCEF741BF1583CD9DA816C8F089261B537AF2E5D0757AE92B2CE9B76C4A6EF',
  r: '-0xCCEF741BF1583CD9DA816C8F089261B537AF2E5D0757AE92B2CE9B76C4A6F0',
}, {
  a: '-0x83BD8CD30388014921BFE82FF7459698AA42E1BC46FB002321BDABAD5A',
  r: '0x83BD8CD30388014921BFE82FF7459698AA42E1BC46FB002321BDABAD59',
}, {
  a: '0x2071ACBECF013F43B153256D6E92C349EB5518F6DFB267927',
  r: '-0x2071ACBECF013F43B153256D6E92C349EB5518F6DFB267928',
}, {
  a: '-0xD7361E96360B4CEDD00706019804E9C7980F3F801B1FFD343CA4CF189AAD661F2C',
  r: '0xD7361E96360B4CEDD00706019804E9C7980F3F801B1FFD343CA4CF189AAD661F2B',
}, {
  a: '-0x431418156CD36BB379EB08E28F14FAC37C4C057EE794DA9F4C02DB39EE83E129',
  r: '0x431418156CD36BB379EB08E28F14FAC37C4C057EE794DA9F4C02DB39EE83E128',
}, {
  a: '0x6F8075F1919CFC1F7540E6617761D99A66DF3998F507E681B0CA2444D',
  r: '-0x6F8075F1919CFC1F7540E6617761D99A66DF3998F507E681B0CA2444E',
}, {
  a: '-0xA56985BE30FB4E40C1D374F9786C4947423AFAB433C276D4E4FEE3753DB182830',
  r: '0xA56985BE30FB4E40C1D374F9786C4947423AFAB433C276D4E4FEE3753DB18282F',
}, {
  a: '0xB9A02DECF240DE2F08570C566DA19DC575C',
  r: '-0xB9A02DECF240DE2F08570C566DA19DC575D',
}, {
  a: '0xC0FEBEE47FEC17AD7C315B844D592569A4159AF843C74E97B1635A636EDB2EA99608F1',
  r: '-0xC0FEBEE47FEC17AD7C315B844D592569A4159AF843C74E97B1635A636EDB2EA99608F2',
}, {
  a: '-0xD42340C8C0E7B24709466689A52AF73952F0E893E6C1',
  r: '0xD42340C8C0E7B24709466689A52AF73952F0E893E6C0',
}, {
  a: '-0x81D675F6DFE4130F4CA9DA8807BCFA5327CED3CD2B5C66F35F611A3D4CA27',
  r: '0x81D675F6DFE4130F4CA9DA8807BCFA5327CED3CD2B5C66F35F611A3D4CA26',
}, {
  a: '0x201D57466820F7BD4C72A367045BC76C978D50FCD7F1E195EE54F27F46A01C91',
  r: '-0x201D57466820F7BD4C72A367045BC76C978D50FCD7F1E195EE54F27F46A01C92',
}, {
  a: '-0x4F634ED543589389A6512F74186AADB3C7E781421D5EB3CFE3AF1',
  r: '0x4F634ED543589389A6512F74186AADB3C7E781421D5EB3CFE3AF0',
}, {
  a: '-0x59078B8C7663A5C89A8F60860F285C19591CFCD8F',
  r: '0x59078B8C7663A5C89A8F60860F285C19591CFCD8E',
}, {
  a: '0x9A8A112F1CF28365FCE19729C60B3B4E6B134A4DADBACD85B3D9710CD95B',
  r: '-0x9A8A112F1CF28365FCE19729C60B3B4E6B134A4DADBACD85B3D9710CD95C',
}, {
  a: '0x5C0EEFC6D376EF39248E5D27B50A71646BA53EAE0E9BB7FE48786',
  r: '-0x5C0EEFC6D376EF39248E5D27B50A71646BA53EAE0E9BB7FE48787',
}, {
  a: '-0x344E5BE73E6436B2979BE4C1071F485473FA31C4C25',
  r: '0x344E5BE73E6436B2979BE4C1071F485473FA31C4C24',
}, {
  a: '-0xBA69FD00B58BCF8951ED2317A010EEF214CF4CB5FADD05E73343A69A',
  r: '0xBA69FD00B58BCF8951ED2317A010EEF214CF4CB5FADD05E73343A699',
}, {
  a: '0x42CF42A9CFE77B971085135B0FA2DBE0DE5338',
  r: '-0x42CF42A9CFE77B971085135B0FA2DBE0DE5339',
}, {
  a: '-0x6998855F94A80F6C8F4B8D304E68F762027AE849007F3E4BB9A01F7',
  r: '0x6998855F94A80F6C8F4B8D304E68F762027AE849007F3E4BB9A01F6',
}, {
  a: '0xA972421F85E343511FAC40B25600FBB9B287087B53929494B51',
  r: '-0xA972421F85E343511FAC40B25600FBB9B287087B53929494B52',
}, {
  a: '0x35B67DA9A9AABD833B551E3F226E3B26312887A078BF89ADA92',
  r: '-0x35B67DA9A9AABD833B551E3F226E3B26312887A078BF89ADA93',
}, {
  a: '0x7771E74C8E6AE4DF4409566B877A2258F53809880CE95058D290BA97',
  r: '-0x7771E74C8E6AE4DF4409566B877A2258F53809880CE95058D290BA98',
}, {
  a: '-0xE1428B0195EFAAD4F3031CA4B78B6F493E5CEC71E01C2F17',
  r: '0xE1428B0195EFAAD4F3031CA4B78B6F493E5CEC71E01C2F16',
}, {
  a: '-0x283844C4B7BDE244D377EB06E4E74F16A6CC8355F0A974ECB69A3ECA4A1EBEBBD9',
  r: '0x283844C4B7BDE244D377EB06E4E74F16A6CC8355F0A974ECB69A3ECA4A1EBEBBD8',
}, {
  a: '0x739D96020B9D72FEA15DF19B6C7BC4EBD5B5',
  r: '-0x739D96020B9D72FEA15DF19B6C7BC4EBD5B6',
}, {
  a: '0x3B1F98A86B6050BAFA8573D601141D758DCE9B2B90CBA148DE875',
  r: '-0x3B1F98A86B6050BAFA8573D601141D758DCE9B2B90CBA148DE876',
}, {
  a: '0xD75B66F7323D810D7C4F787F84EAF1171D1C3F1DD154AC6',
  r: '-0xD75B66F7323D810D7C4F787F84EAF1171D1C3F1DD154AC7',
}, {
  a: '0x7D62A5B28B23809B11DFA27F8EEF8BF4132A921',
  r: '-0x7D62A5B28B23809B11DFA27F8EEF8BF4132A922',
}, {
  a: '0xD27F04155BBBA25BD0C15F29BA86F35F504B66988A9',
  r: '-0xD27F04155BBBA25BD0C15F29BA86F35F504B66988AA',
}, {
  a: '-0x47A8476CCDC30D66C193D67D469C4352835C',
  r: '0x47A8476CCDC30D66C193D67D469C4352835B',
}, {
  a: '-0x60F4F07F120BDC721A4D0BD372C0ADE4A4DFBF82564B36DFDCB3B4',
  r: '0x60F4F07F120BDC721A4D0BD372C0ADE4A4DFBF82564B36DFDCB3B3',
}, {
  a: '-0x653DFB90425A02B9BDA6A0E501296BC1A083D',
  r: '0x653DFB90425A02B9BDA6A0E501296BC1A083C',
}, {
  a: '0x6B12B42B29B40F9CE9D4F6A04D12D02CD62C4A92EF279358C65174DAF851D',
  r: '-0x6B12B42B29B40F9CE9D4F6A04D12D02CD62C4A92EF279358C65174DAF851E',
}, {
  a: '0x5348319837A0B4C45618433613A9FD301F063E',
  r: '-0x5348319837A0B4C45618433613A9FD301F063F',
}, {
  a: '-0x524656187EF5CFA81505BCF8DB488CCBDA11A6477E301CEFF7A7CE',
  r: '0x524656187EF5CFA81505BCF8DB488CCBDA11A6477E301CEFF7A7CD',
}, {
  a: '0xC335DD1D194C2F36F0CF459300A78FE60ED',
  r: '-0xC335DD1D194C2F36F0CF459300A78FE60EE',
}, {
  a: '-0x75ACEFE7AF5EA73B39B5FE87744713308CBB33C79',
  r: '0x75ACEFE7AF5EA73B39B5FE87744713308CBB33C78',
}, {
  a: '-0xAFB4AD7A15A5D19A9E8E198688DB6459B056',
  r: '0xAFB4AD7A15A5D19A9E8E198688DB6459B055',
}, {
  a: '-0x4DED7D225E89DF2E45006CD89030ACCFE8B',
  r: '0x4DED7D225E89DF2E45006CD89030ACCFE8A',
}, {
  a: '0xBD006A6A21BC549F234E0D7E0FDBD8049EA3BA27CB069',
  r: '-0xBD006A6A21BC549F234E0D7E0FDBD8049EA3BA27CB06A',
}, {
  a: '-0xB2879BAA5DBC94CCF8DE56422DC4405BC383E0',
  r: '0xB2879BAA5DBC94CCF8DE56422DC4405BC383DF',
}, {
  a: '-0xB8627273C0FD128AC8EAE61E4B981A46CF6A2A72185C3FD7F36',
  r: '0xB8627273C0FD128AC8EAE61E4B981A46CF6A2A72185C3FD7F35',
}, {
  a: '0x7940752722AD97E98ECCBA630832FE7AB714969A4F648EE',
  r: '-0x7940752722AD97E98ECCBA630832FE7AB714969A4F648EF',
}, {
  a: '0x4D1870C7B9B9B6A215600E32F7DA2ED7396B29474958654A1EBCD47',
  r: '-0x4D1870C7B9B9B6A215600E32F7DA2ED7396B29474958654A1EBCD48',
}, {
  a: '-0x489F8D865096E9E3AC1B96530ECC032BE1856DEB99',
  r: '0x489F8D865096E9E3AC1B96530ECC032BE1856DEB98',
}, {
  a: '-0x30728B1154B28A1795D4C255F679A508105274CDE7E06F184',
  r: '0x30728B1154B28A1795D4C255F679A508105274CDE7E06F183',
}, {
  a: '-0x64A512104FC1952724CADD46D818ED9C4E07F574B5F08C9DE4F901FFE1A98775',
  r: '0x64A512104FC1952724CADD46D818ED9C4E07F574B5F08C9DE4F901FFE1A98774',
}, {
  a: '0x6FDD337A042E2BDADBD9A7DF1B6C1C64C5841A816661D2702203854A7B8D9483486BA',
  r: '-0x6FDD337A042E2BDADBD9A7DF1B6C1C64C5841A816661D2702203854A7B8D9483486BB',
}, {
  a: '-0x73E22C464F05F37CCB2395FD86B6532E4AA7FF4812AD9DD6397750DEC8CC08',
  r: '0x73E22C464F05F37CCB2395FD86B6532E4AA7FF4812AD9DD6397750DEC8CC07',
}, {
  a: '-0xEC6BB160E657AFA8F7A87179DDAA3B39D65B1CB1AD580C7244D2B60077D0A31',
  r: '0xEC6BB160E657AFA8F7A87179DDAA3B39D65B1CB1AD580C7244D2B60077D0A30',
}, {
  a: '-0x715C3344A4D16EECD5BCB98011467C74CE2B6EDF9842D168DAB20C313B4670C62',
  r: '0x715C3344A4D16EECD5BCB98011467C74CE2B6EDF9842D168DAB20C313B4670C61',
}, {
  a: '-0xA0FC37D5B2BBBBEBFAC34D3A8509B98C1FE',
  r: '0xA0FC37D5B2BBBBEBFAC34D3A8509B98C1FD',
}, {
  a: '0x790501BDA4EDF92B04B52669FEBF6C763AC83D7FC3B290',
  r: '-0x790501BDA4EDF92B04B52669FEBF6C763AC83D7FC3B291',
}, {
  a: '-0x3D26C144B0357115CC1DD388F61AFA8F5E3EA82B2ACB',
  r: '0x3D26C144B0357115CC1DD388F61AFA8F5E3EA82B2ACA',
}, {
  a: '-0x75F4009D70E719ED60E9365E4CAB3D7A6BA9B529ABBD5FB9A4D9167CDEB505D35F08AA',
  r: '0x75F4009D70E719ED60E9365E4CAB3D7A6BA9B529ABBD5FB9A4D9167CDEB505D35F08A9',
}, {
  a: '0xB7F574305ABA5CA5B68DBC4120235AFDF4658BBB499695BAD4',
  r: '-0xB7F574305ABA5CA5B68DBC4120235AFDF4658BBB499695BAD5',
}, {
  a: '-0x9C4A7E17AA2B38DA89329A2383B7E8ED3AAF10E86FC69EC2678D4B594C',
  r: '0x9C4A7E17AA2B38DA89329A2383B7E8ED3AAF10E86FC69EC2678D4B594B',
}, {
  a: '-0x842270164B2D8C503DF49CFDA5DF0C7DE1B2FD89DA554441A4CF',
  r: '0x842270164B2D8C503DF49CFDA5DF0C7DE1B2FD89DA554441A4CE',
}, {
  a: '-0x35BC11C2507A0EF78F3FBB15599DE2525E9F1F0C1F1C43006EAD5AD115C4F3491',
  r: '0x35BC11C2507A0EF78F3FBB15599DE2525E9F1F0C1F1C43006EAD5AD115C4F3490',
}, {
  a: '0x332F8ADD0E328DA6BAB36C1EE5180BAB57C22B7',
  r: '-0x332F8ADD0E328DA6BAB36C1EE5180BAB57C22B8',
}, {
  a: '-0xE742D5489259A91EA757A22D841BD398094C4F0CFD0B4F5193576443081CDFEB5B1EF1',
  r: '0xE742D5489259A91EA757A22D841BD398094C4F0CFD0B4F5193576443081CDFEB5B1EF0',
}, {
  a: '0x1E40F9E4F88C224E04AC84E81F35C90FAC6F8713535D67F',
  r: '-0x1E40F9E4F88C224E04AC84E81F35C90FAC6F8713535D680',
}];

const dataSmall = [{
  a: '0x12C21',
  r: '-0x12C22',
}, {
  a: '-0xCA2F614C29589',
  r: '0xCA2F614C29588',
}, {
  a: '-0xD76C91D03989B',
  r: '0xD76C91D03989A',
}, {
  a: '-0xF9D',
  r: '0xF9C',
}, {
  a: '-0x18',
  r: '0x17',
}, {
  a: '0xD649A88E92B',
  r: '-0xD649A88E92C',
}, {
  a: '0x6E3908856AA',
  r: '-0x6E3908856AB',
}, {
  a: '-0x8E89',
  r: '0x8E88',
}, {
  a: '0x5B',
  r: '-0x5C',
}, {
  a: '0x4A608DAE0',
  r: '-0x4A608DAE1',
}, {
  a: '-0x40E9D602DE552',
  r: '0x40E9D602DE551',
}, {
  a: '-0xBDFEB343F8B1BC81',
  r: '0xBDFEB343F8B1BC80',
}, {
  a: '0x4C22CCE4',
  r: '-0x4C22CCE5',
}, {
  a: '0x89F',
  r: '-0x8A0',
}, {
  a: '0xC',
  r: '-0xD',
}, {
  a: '-0x2B358CBD2D90B7',
  r: '0x2B358CBD2D90B6',
}, {
  a: '-0xB',
  r: '0xA',
}, {
  a: '0x83B2E7F8A0E',
  r: '-0x83B2E7F8A0F',
}, {
  a: '-0x9775FD52',
  r: '0x9775FD51',
}, {
  a: '0x9028',
  r: '-0x9029',
}, {
  a: '-0x7AD9D',
  r: '0x7AD9C',
}, {
  a: '0x0',
  r: '-0x1',
}, {
  a: '-0x7A',
  r: '0x79',
}, {
  a: '-0xD97C7248CF98',
  r: '0xD97C7248CF97',
}, {
  a: '0xE3335537',
  r: '-0xE3335538',
}, {
  a: '0x7',
  r: '-0x8',
}, {
  a: '-0xE9BF86F9DE8',
  r: '0xE9BF86F9DE7',
}, {
  a: '-0x55BC7644A8A',
  r: '0x55BC7644A89',
}, {
  a: '0x52A02',
  r: '-0x52A03',
}, {
  a: '0xC0649B618B023',
  r: '-0xC0649B618B024',
}, {
  a: '0x0',
  r: '-0x1',
}, {
  a: '0x0',
  r: '-0x1',
}, {
  a: '0x60F0E323D3',
  r: '-0x60F0E323D4',
}, {
  a: '-0xAA2286',
  r: '0xAA2285',
}, {
  a: '-0xD1E8079388B9DB0A',
  r: '0xD1E8079388B9DB09',
}, {
  a: '0xDF4BF2042BA62',
  r: '-0xDF4BF2042BA63',
}, {
  a: '0x148E92A2957AB72B',
  r: '-0x148E92A2957AB72C',
}, {
  a: '-0xC5E7A93C',
  r: '0xC5E7A93B',
}, {
  a: '-0x962CDD2262D',
  r: '0x962CDD2262C',
}, {
  a: '0x5A001900A',
  r: '-0x5A001900B',
}, {
  a: '0xE17192E',
  r: '-0xE17192F',
}, {
  a: '-0xD9D48ADE77F',
  r: '0xD9D48ADE77E',
}, {
  a: '-0x69',
  r: '0x68',
}, {
  a: '-0x6A8357B',
  r: '0x6A8357A',
}, {
  a: '-0x9E2',
  r: '0x9E1',
}, {
  a: '-0x6A',
  r: '0x69',
}, {
  a: '-0x85858C5DCAAC',
  r: '0x85858C5DCAAB',
}, {
  a: '-0x42C1F760FBE76D',
  r: '0x42C1F760FBE76C',
}, {
  a: '0x8',
  r: '-0x9',
}, {
  a: '0x350E0EC53D72',
  r: '-0x350E0EC53D73',
}, {
  a: '-0x7D0AF',
  r: '0x7D0AE',
}, {
  a: '0x48F347C78812EF7A',
  r: '-0x48F347C78812EF7B',
}, {
  a: '0xF960',
  r: '-0xF961',
}, {
  a: '0x73475CF14D455',
  r: '-0x73475CF14D456',
}, {
  a: '0xE0E59B7',
  r: '-0xE0E59B8',
}, {
  a: '0x5AA17',
  r: '-0x5AA18',
}, {
  a: '-0xE642CA2494',
  r: '0xE642CA2493',
}, {
  a: '-0x2A69DF',
  r: '0x2A69DE',
}, {
  a: '-0xCF259F76FE',
  r: '0xCF259F76FD',
}, {
  a: '0x9',
  r: '-0xA',
}, {
  a: '0x1163B',
  r: '-0x1163C',
}, {
  a: '-0xD822C4F7202C',
  r: '0xD822C4F7202B',
}, {
  a: '0x3DC61B60',
  r: '-0x3DC61B61',
}, {
  a: '-0xA5FA6225E8',
  r: '0xA5FA6225E7',
}, {
  a: '-0x11C82C',
  r: '0x11C82B',
}, {
  a: '-0xF4',
  r: '0xF3',
}, {
  a: '-0x7A608FD19',
  r: '0x7A608FD18',
}, {
  a: '-0x97EDC',
  r: '0x97EDB',
}, {
  a: '-0x11A59FA179C',
  r: '0x11A59FA179B',
}, {
  a: '0x2222',
  r: '-0x2223',
}, {
  a: '-0x53FD67FCB688C302',
  r: '0x53FD67FCB688C301',
}, {
  a: '-0xB07',
  r: '0xB06',
}, {
  a: '0x5C79A',
  r: '-0x5C79B',
}, {
  a: '-0xBF29AB2C4A38D',
  r: '0xBF29AB2C4A38C',
}, {
  a: '0x71ACC41',
  r: '-0x71ACC42',
}, {
  a: '-0x9494853FAA26',
  r: '0x9494853FAA25',
}, {
  a: '0xE73D93A35A9C',
  r: '-0xE73D93A35A9D',
}, {
  a: '0x18DD0EA8',
  r: '-0x18DD0EA9',
}, {
  a: '0xF486FC7E29',
  r: '-0xF486FC7E2A',
}, {
  a: '0x602E99BE2BD0B3',
  r: '-0x602E99BE2BD0B4',
}, {
  a: '-0x3A3B02D2827FCF',
  r: '0x3A3B02D2827FCE',
}, {
  a: '-0x557EC38D9',
  r: '0x557EC38D8',
}, {
  a: '0xB',
  r: '-0xC',
}, {
  a: '0xDC1E18D8D2A2',
  r: '-0xDC1E18D8D2A3',
}, {
  a: '0x0',
  r: '-0x1',
}, {
  a: '-0xD988399',
  r: '0xD988398',
}, {
  a: '-0x5FE766B338F2',
  r: '0x5FE766B338F1',
}, {
  a: '-0xE9F00DC79CE',
  r: '0xE9F00DC79CD',
}, {
  a: '0xA9CB3C5E72CAD7',
  r: '-0xA9CB3C5E72CAD8',
}, {
  a: '-0x41B1E0AC',
  r: '0x41B1E0AB',
}, {
  a: '-0x49240AC9586',
  r: '0x49240AC9585',
}, {
  a: '-0x8EFCC2342D47D16',
  r: '0x8EFCC2342D47D15',
}, {
  a: '-0xD14AD9B1EF19C',
  r: '0xD14AD9B1EF19B',
}, {
  a: '-0x104A3E7317B5072E',
  r: '0x104A3E7317B5072D',
}, {
  a: '0x94AA9A7E20462',
  r: '-0x94AA9A7E20463',
}, {
  a: '0x0',
  r: '-0x1',
}, {
  a: '0x33C',
  r: '-0x33D',
}, {
  a: '-0x580708471',
  r: '0x580708470',
}, {
  a: '0x20A24871',
  r: '-0x20A24872',
}, {
  a: '-0x531A',
  r: '0x5319',
}];

import JSBI from '../dist/jsbi.mjs';
const JSBigInt = JSBI.BigInt;

let errorCount = 0;

const dataBigNative = [];
const dataBigJsbi = [];
const dataSmallNative = [];
const dataSmallJsbi = [];

function hexParseN(s) {
  if (s.charCodeAt(0) === 0x2D) return -BigInt(s.slice(1));
  return BigInt(s);
}
function parseNative(d) {
  if (d.b) {
    return {a: hexParseN(d.a), b: hexParseN(d.b), r: hexParseN(d.r)};
  }
  return {a: hexParseN(d.a), r: hexParseN(d.r)};
}
function hexParse(s) {
  if (s.charCodeAt(0) === 0x2D) {
    const result = JSBigInt(s.slice(1));
    result.sign = true;
    return result;
  }
  return JSBigInt(s);
}
function parseJSBI(d) {
  if (d.b) {
    return {a: hexParse(d.a), b: hexParse(d.b), r: hexParse(d.r)};
  }
  return {a: hexParse(d.a), r: hexParse(d.r)};
}
function prepareData(src, dstNative, dstJsbi) {
  for (let i = 0; i < src.length; i++) {
    const d = src[i];
    dstNative.push(parseNative(d));
    dstJsbi.push(parseJSBI(d));
  }
}
prepareData(dataBig, dataBigNative, dataBigJsbi);
prepareData(dataSmall, dataSmallNative, dataSmallJsbi);


function testNative(data, reps) {
  for (let i = 0; i < data.length; i++) {
    const d = data[i];
    const r = ~d.a;
    if (d.r !== r) {
      console.log('Input:    ' + d.a.toString(16));
      console.log('Result:   ' + r.toString(16));
      console.log('Expected: ' + d.r.toString(16));
      console.log('Op: ~');
      errorCount++;
    }
  }
  let r;
  const t1 = Date.now();
  for (let j = 0; j < reps; j++) {
    for (let i = 0; i < data.length; i++) {
      const d = data[i];
      r = ~d.a;
    }
  }
  // Confuse the compiler into thinking that the loop is needed :-)
  const d = data[data.length - 1];
  if (d.r !== r) throw new Error('no dead code elimination please');
  return Date.now() - t1;
}


function testJsbi(data, reps) {
  for (let i = 0; i < data.length; i++) {
    const d = data[i];
    const r = JSBI.bitwiseNot(d.a);
    if (!JSBI.equal(r, d.r)) {
      console.log('Input:    ' + d.a.toString(16));
      console.log('Result:   ' + r.toString(16));
      console.log('Expected: ' + d.r.toString(16));
      console.log('Op: bitwiseNot');
      errorCount++;
    }
  }
  let r;
  const t1 = Date.now();
  for (let j = 0; j < reps; j++) {
    for (let i = 0; i < data.length; i++) {
      const d = data[i];
      r = JSBI.bitwiseNot(d.a);
    }
  }
  // Confuse the compiler into thinking that the loop is needed :-)
  const d = data[data.length - 1];
  if (!JSBI.equal(r, d.r)) throw new Error('no dead code elimination please');
  return Date.now() - t1;
}


const kRepsBig = 40000;
const kRepsSmall = 120000;

console.log('Testing bitwiseNot:');
console.log('Native/big:   ' + testNative(dataBigNative, kRepsBig));
console.log('JSBI/big:     ' + testJsbi(dataBigJsbi, kRepsBig));
console.log('Native/small: ' + testNative(dataSmallNative, kRepsSmall));
console.log('JSBI/small:   ' + testJsbi(dataSmallJsbi, kRepsSmall));

if (errorCount !== 0) {
  console.error('Finished with ' + errorCount + ' errors.');
  // Support both d8 (`quit`) and Node.js (`process.exit`).
  (typeof quit !== 'undefined' ? quit : process.exit)(1);
}
